﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="~/Admin/Remitos.aspx.cs" Inherits="AdmRemitos" MasterPageFile="~/MasterPage.master" %>

<%@ Register Src="../UserControls/Rubros.ascx" TagName="Rubros" TagPrefix="uc2" %>

<%@ Register Src="../UserControls/Fecha.ascx" TagName="Fecha" TagPrefix="uc1" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="content" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    &nbsp;<asp:ScriptManager id="ScriptManager1" runat="server"></asp:ScriptManager>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<table class="tablaForm">
        <tr>
            <td class="tdStock" colspan="6" style="width: 100%; text-align: center">
                REMITO</td>
        </tr>
        <tr>
            <td class="tdLiteral" colspan="6" style="text-align: center; height: 17px;">
                <asp:Label ID="lblAccion" runat="server" CssClass="lblAccion" Text="Label"></asp:Label></td>
        </tr>
        <tr>
            <td class="tdForm" colspan="1" rowspan="2" style="width: 20%; text-align: center">
                Op.Nro.:<asp:TextBox ID="txtIdRemito" runat="server" OnTextChanged="txtIdCliente_TextChanged"
                    ReadOnly="True" Width="60%"></asp:TextBox>
            </td>
            <td class="tdForm" style="width: 15%; text-align: right">
                Cliente:</td>
            <td class="tdForm" colspan="1" style="width: 20%; text-align: left">
                <asp:TextBox ID="txtIdCliente" runat="server" AutoPostBack="True" OnTextChanged="txtIdCliente_TextChanged"
                    Width="70px"></asp:TextBox>&nbsp;
                <asp:Button ID="btnBuscarCliente" runat="server" OnClick="btnBuscarCliente_Click"
                    TabIndex="2" Text="..." /></td>
            <td class="tdForm" colspan="4" style="width: 45%; text-align: left">
                <asp:TextBox ID="txtCliente" runat="server" Width="100%"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="tdForm" colspan="2" style="text-align: right">
                Saldo Cta. Cte. :</td>
            <td class="tdForm" colspan="4" style="width: 170px; text-align: left">
                <asp:TextBox ID="txtSaldo" runat="server" Width="100px"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="tdForm" style="width: 20%; text-align: right">
                Dirección Entrega:</td>
            <td class="tdForm" colspan="6" style="text-align: left">
                <asp:TextBox ID="txtDireccion" runat="server" Width="100%"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="tdForm" colspan="1" rowspan="1" style="width: 20%; text-align: right">
                Forma:
                <asp:Label ID="lblFormato" runat="server" CssClass="lblAccion">R</asp:Label>
                Talonario:</td>
            <td class="tdForm" colspan="2" style="text-align: left">
                <asp:DropDownList ID="cboTalon" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cboTalon_SelectedIndexChanged"
                    Width="80%">
                </asp:DropDownList></td>
            <td runat="server" class="tdForm" colspan="1" style="text-align: right">
                Remito N&uacute;mero:</td>
            <td runat="server" class="tdForm" colspan="3" style="text-align: left">
                <asp:TextBox ID="txtPrefijo" runat="server" AutoPostBack="True" Width="60px"  ReadOnly="True"></asp:TextBox>&nbsp;
                <asp:TextBox ID="txtRemito" runat="server" AutoPostBack="True" OnTextChanged="txtFactura_TextChanged"
                    Width="70px"></asp:TextBox>
                <asp:RangeValidator ID="rvRemito" runat="server" ControlToValidate="txtRemito"
                    ErrorMessage="(*)" MaximumValue="999999999" MinimumValue="1" Type="Double"></asp:RangeValidator></td>
        </tr>
        <tr>
            <td class="tdForm" colspan="1" rowspan="1" style="width: 20%; text-align: right">
                &nbsp;Fecha:</td>
            <td class="tdForm" colspan="2" style="text-align: left">
                <uc1:Fecha ID="Fecha" runat="server" />
                </td>
            <td id="tdFactura1" runat="server" class="tdForm" colspan="1" style="text-align: right">
                <asp:Label ID="lblFechaCambio" runat="server" CssClass="lblAccion"></asp:Label></td>
            <td id="tdFactura2" runat="server" class="tdForm" colspan="3" style="text-align: left">
                <uc1:Fecha ID="FechaCambio" runat="server" /></td>
        </tr>
        <tr id="trEstado" runat="server">
            <td class="tdForm" colspan="1" rowspan="1" style="width: 20%; text-align: right">
                Estado:</td>
            <td class="tdForm" colspan="2" style="text-align: left">
                <asp:TextBox ID="txtEstado" runat="server" ReadOnly="True" Width="100px"></asp:TextBox></td>
            <td runat="server" class="tdForm" colspan="1" style="text-align: right">
                <asp:TextBox ID="txtDias" runat="server" ReadOnly="True" Width="100px"></asp:TextBox></td>
            <td runat="server" class="tdForm" colspan="3" style="text-align: left">
            </td>
        </tr>
        <tr id="trArticulo1" runat="server">
            <td class="tdForm" colspan="6" style="text-align: center; height: 64px;">
                <table style="width: 100%">
                    <tr>
                        <td class="tdForm" style="width: 5%; text-align: right">
                            Art&iacute;culo:</td>
                        <td id="tdIdArticulo" runat="server" class="tdForm" style="width: 20%; text-align: left">
                            <asp:TextBox ID="txtIdArticulo" runat="server" Width="80px"></asp:TextBox>
                            <asp:Button ID="btnBuscarArticulo" runat="server" OnClick="btnBuscarArticulo_Click"
                                Text="..." />
                            </td>
                        <td id="tdArticulo" runat="server" class="tdForm" style="width: 40%; text-align: left">
                            <asp:TextBox ID="txtArticulo" runat="server" Width="98%"></asp:TextBox>
                            </td>
                        <td class="tdForm" style="width: 5%; text-align: right">
                            Stock:</td>
                        <td id="tdStock" runat="server" class="tdForm" style="width: 10%; text-align: left">
                            <asp:TextBox ID="txtStock" runat="server" Width="50px"></asp:TextBox>
                            </td>
                        <td class="tdForm" style="width: 5%; text-align: right">
                            <asp:Label ID="lblLote" runat="server" Text="Lote:"></asp:Label></td>
                        <td class="tdForm" style="width: 15%; text-align: left">
                            <asp:TextBox ID="txtLote" runat="server" Width="50px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td class="tdForm" colspan="2" style="text-align: right;">
                            C&oacute;digo de Barras:</td>
                        <td runat="server" class="tdForm" colspan="5" style="text-align: left;">
                            <asp:TextBox ID="txtCodBarra" runat="server" MaxLength="50" TabIndex="1" Width="70%"></asp:TextBox>
                            <asp:Button ID="btnCodBarra" runat="server" OnClick="btnCodBarra_Click" Text="..." />
                            <asp:TextBox ID="txtCantBarra" runat="server" Columns="4" MaxLength="4">1</asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr id="trArticulo2" runat="server">
            <td class="tdForm" colspan="6" rowspan="1" style="text-align: center">
                <table style="width: 100%">
                    <tr>
                        <td class="tdForm" style="text-align: right" colspan="4">
                            &nbsp;Cantidad:&nbsp;</td>
                        <td class="tdForm" style="color: #000000; text-align: left" colspan="2">
                            <asp:TextBox ID="txtCantidad" runat="server" Columns="4" CssClass="numero"></asp:TextBox>
                            <asp:RangeValidator ID="rvCantidad" runat="server" ControlToValidate="txtCantidad"
                                ErrorMessage="(*)" MaximumValue="99999999.99" MinimumValue="0.01" ValidationGroup="Agregar"></asp:RangeValidator></td>
                        <td class="tdLiteral" style="width: 15%; text-align: center">
                            <asp:Button ID="btnAgregar" runat="server" OnClick="btnAgregar_Click" Text="Agregar" /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="tdForm" colspan="6" rowspan="1" style="text-align: center">
                <table style="width: 100%">
                    <tr>
                        <td class="tdForm" style="width: 100%">
                            <asp:GridView ID="gvRemitosDet" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
                                CellPadding="3" DataKeyNames="Item" GridLines="Vertical" OnPageIndexChanging="gvRemitosDet_PageIndexChanging"
                                OnRowDataBound="gvRemitosDet_RowDataBound" OnRowDeleting="gvRemitosDet_RowDeleting"
                                Width="100%">
                                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Item">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Item" runat="server" Text='<%# Bind("Item") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="C&#243;digo">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Código" runat="server" Text='<%# Bind("Id_Articulo") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Art&#237;culo">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Titular" runat="server" Text='<%# Bind("Articulo") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Lote">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Lote" runat="server" Text='<%# Bind("Lote") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Fecha Vto.">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="FechaVto" runat="server" Text='<%# Bind("FechaVto", "{0:dd/MM/yyyy}") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cant.">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Kilos" runat="server" Text='<%# Bind("Kilos") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ShowDeleteButton="True" DeleteText="Eliminar">
                                        <ItemStyle ForeColor="Blue" />
                                    </asp:CommandField>
                                </Columns>
                                <RowStyle BackColor="#EEEEEE" ForeColor="Black" HorizontalAlign="Center" />
                                <EditRowStyle Wrap="True" />
                                <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                <HeaderStyle BackColor="#325FB9" Font-Bold="True" Font-Names="Arial Rounded MT Bold"
                                    ForeColor="White" />
                                <AlternatingRowStyle BackColor="Gainsboro" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="tdForm" colspan="6" style="text-align: center">
                <asp:TextBox ID="txtObs" runat="server" Rows="3" TextMode="MultiLine" Width="90%" Font-Size="Small"></asp:TextBox></td>
        </tr>
         <tr>
            <td class="tdTit" style="width: 15%; text-align: center">
                Datos para</td>
            <td class="tdTit" colspan="2" style="width: 15%; text-align: center">
                &nbsp;Condiciones de Venta</td>
            <td align="center" class="tdTit" style="width: 15%; text-align: center">
                Orden Compra</td>
            <td class="tdTit" style="width: 15%; text-align: center">
                Orden Trabajo</td>
            <td class="tdTit" style="width: 15%; text-align: center">
                </td>
        </tr>
         <tr>
            <td class="tdTit" style="width: 15%; text-align: right">
                Imprimir Remito:</td>
            <td class="tdForm" colspan="2" style="width: 40%; text-align: left">
                &nbsp;<asp:TextBox ID="txtCondVenta" runat="server" Width="90%"></asp:TextBox></td>
            <td align="center" class="tdForm" style="width: 15%; text-align: right">
                <asp:TextBox ID="txtOrdenC" runat="server" Width="100px"></asp:TextBox></td>
            <td class="tdForm" style="width: 15%; text-align: right">
                <asp:TextBox ID="txtOrdenT" runat="server" Width="100px"></asp:TextBox></td>
            <td class="tdForm" style="width: 15%; text-align: center">
                </td>
        </tr>
        <tr>
            <td class="tdBotones" colspan="6" style="text-align: center">
                <asp:Button ID="btnLimpiar" runat="server" OnClick="btnLimpiar_Click" Text="Limpiar"
                    Width="75px" />
                &nbsp;
                <asp:Button ID="btnGuardar" runat="server" OnClick="btnGuardar_Click" Text="Guardar"
                    Width="75px" />&nbsp;
                <asp:Button ID="btnNuevoRemito" runat="server" OnClick="btnNuevoRemito_Click" Text="Nuevo Remito"
                    Width="75px" />&nbsp;
                <asp:Button ID="btnFacturar" runat="server" OnClick="btnFacturar_Click" Text="Facturar"
                    Width="75px" />
                &nbsp;<asp:Button ID="btnAnular" runat="server" OnClick="btnAnular_Click"
                        Text="Anular" Width="75px" />&nbsp;
                <asp:Button ID="btnImprimir" runat="server" OnClick="btnImprimir_Click"
                        Text="Imprimir" Width="75px" />&nbsp;
                <asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click"
                        Text="Cancelar" Width="75px" /></td>
        </tr>
    </table>
    <br />      
    <asp:Panel ID="pnlMensaje" runat="server" CssClass="tdBotones" Style="display: none"
        Width="233px">
        <div style="background-image: none; background-color: transparent; text-align: center">
            <asp:Label ID="lblMensaje" runat="server" Text="Códido de Barras Inexistente"></asp:Label>
            <br />
            <br />
            <asp:Button ID="btnMensaje" runat="server" Text="OK" Width="64px" />
        </div>
    </asp:Panel>
    <table id="tblMensaje" runat="server" border="0" style="width: 0px; height: 0px">
        <tr>
            <td style="width: 100px; height: 18px">
                <asp:Button ID="btnMalMensaje" runat="server" Height="0px" Text="Button" Width="0px" />
            </td>
        </tr>
    </table>
    <cc1:ModalPopupExtender ID="mpeMensaje" runat="server" BackgroundCssClass="modalBackground"
        DropShadow="true" OkControlID="btnMensaje" PopupControlID="pnlMensaje" TargetControlID="btnMalMensaje">
    </cc1:ModalPopupExtender>
     <asp:HiddenField ID="txtRubro" runat="server" />
     <asp:HiddenField ID="txtSubRubro" runat="server" />
</asp:Content>
